<template>
  <component
    :is="currentName"
    ref="templateRef"
    :timeType="timeType"
    :defaultValue="defaultValue"
    :maxlength="maxlength"
    :minlength="minlength"
    :InputType="InputType"
    :InputIsdisabled="InputIsdisabled"
    :timeRange="timeRange"
    :SelectIsdisabled="SelectIsdisabled"
    :SelectIsMultiple="SelectIsMultiple"
    :SelectIsClear="SelectIsClear"
    :SelectIsSearch="SelectIsSearch"
    :SwitchIsdisabled="SwitchIsdisabled"
    :switchOpen="switchOpen"
    :switchClose="switchClose"
    :RadioIsdisabled="RadioIsdisabled"
    :RadioSize="RadioSize"
    :RadioIsBorder="RadioIsBorder"
    :checkboxIsdisabled="checkboxIsdisabled"
    :checkboxSize="checkboxSize"
    :checkboxBorder="checkboxBorder"
  />
</template>

<script>
import { VueExtend } from "godspen-lib";
import components from "./components";
import {
  Input,
  Time,
  Select,
  Switch,
  Radio,
  Checkbox,
} from "./components/template/index.js";
export default {
  computed: {
    currentName() {
      return `template` + this.scopeGet("type") || "templateInput";
    },
  },
  components,
  mixins: [VueExtend.mixin, Input, Time, Select, Switch, Radio, Checkbox],
  name: "my-component",
  label: process.env.LABEL,
  style: process.env.STYLE,
  stack: null, // 是否是堆叠模式 ，false：孩子元素会按楼层一个个向下排布， true: 孩子元素绝对定位，随意放置位置
  childLimit: 9999, //              孩子元素最大限制数
  leaf: false, // 是否是叶子节点，为true的时候该节点下面不能添加节点
  props: {
    type: {
      type: String,
      default: "Input",
      editor: {
        ignore: true,
      },
    },
  },
  editorMethods: {},
  methods: {},
};
</script>

<style lang="stylus" rel="stylesheet/stylus" type="text/stylus" scoped>
.component {
  width: 100%;
  height: 100%;
}
</style>
    